package com.watson.todolist.to;

/**
 * The account class handles holding the User's core account information. It is
 * a transfer object that can be used to access the user's information.
 * 
 * @author Donnie Ward
 * 
 * @since 1.0
 */
public class TodoListAccount {

	/**
	 * User's unique id
	 */
	private static long userId;
	/**
	 * User's user name
	 */
	private String userName;
	/**
	 * User's email address
	 */
	private String emailAddress;

	/**
	 * TodoListAccount instance
	 */
	private static TodoListAccount account;

	/**
	 * Gets the instance of this class. If an instance doesn't exist it creates
	 * an instance to return otherwise the old instance is just returned
	 * 
	 * @return TodoListAccount - TodoListAccount instance
	 */
	public static TodoListAccount getInstance() {
		if (account == null) {
			account = new TodoListAccount();
		}
		return account;
	}

	/**
	 * @return the userId - User's unique id
	 */
	public static long getUserId() {
		return userId;
	}

	/**
	 * @param userId
	 *            the userId to set
	 */
	public void setUserId(long userId) {
		TodoListAccount.userId = userId;
	}

	/**
	 * @return the userName - User's user name
	 */
	public String getUserName() {
		return userName;
	}

	/**
	 * @param userName
	 *            the userName to set
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}

	/**
	 * @return the emailAddress - User's email address
	 */
	public String getEmailAddress() {
		return emailAddress;
	}

	/**
	 * @param emailAddress
	 *            the emailAddress to set
	 */
	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}
}
